32-on-64: All argument registers must be zero extended to 64 bits
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 24 Jan 2007 18:20:24 +0000 (18:20 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 24 Jan 2007 18:20:24 +0000 (18:20 +0000)
(%rdx was missed).
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_64/compat/entry.S

index 6e92ee90f1c1711f04ee8aa99e9542b79c9c17d8..725b25a19e54c488fdd46dd2b13128171300e637 100644 (file)
@@ -16,7 +16,8 @@ ENTRY(compat_hypercall)
         jae   compat_bad_hypercall
 #ifndef NDEBUG
         /* Deliberately corrupt parameter regs not used by this hypercall. */
-        pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq %rdi; pushq UREGS_rbp+5*8(%rsp)
+        pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq %rdi
+        pushq UREGS_rbp+5*8(%rsp)
         leaq  compat_hypercall_args_table(%rip),%r10
         movq  $6,%rcx
         subb  (%r10,%rax,1),%cl
@@ -28,11 +29,13 @@ ENTRY(compat_hypercall)
         pushq %rax
         pushq UREGS_rip+8(%rsp)
 #else
-        movl  %eax,%eax
-        movl  %ebp,%r9d
-        movl  %edi,%r8d
-        xchgl  %ecx,%esi
-        movl  UREGS_rbx(%rsp),%edi
+        /* Relocate argument registers and zero-extend to 64 bits. */
+        movl  %eax,%eax              /* Hypercall #  */
+        movl  UREGS_rbx(%rsp),%edi   /* Arg 1        */
+        xchgl %ecx,%esi              /* Arg 2, Arg 4 */
+        movl  %edx,%edx              /* Arg 3        */
+        movl  %edi,%r8d              /* Arg 5        */
+        movl  %ebp,%r9d              /* Arg 6        */
 #endif
         leaq  compat_hypercall_table(%rip),%r10
         PERFC_INCR(PERFC_hypercalls, %rax)